﻿using System;
using System.Collections.Generic;
using System.Text;

namespace WFL.Office.Excel
{
    public abstract class Disposable : IDisposable
    {
        public event EventHandler Disposed;

        public Disposable()
        { 
        
        }

        protected virtual void OnDisposed()
        {
            if (Disposed != null)
            {
                Disposed(this, EventArgs.Empty);
            }
        }

        protected abstract void Dispose(bool disposing);


        #region IDisposable 成员

        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        #endregion


        ~Disposable()
        {
            Dispose(false);
        }
    }
}
